package com.zy.tools.appletsTools;

import org.json.JSONArray;
import org.json.JSONException;
import org.springframework.stereotype.Component;

@Component
public class TrimTool {
    public String [] trimId(String id) throws JSONException {
        if(id != null){
            JSONArray param = new JSONArray("[" + id + "]");
            System.out.println(param);
            String[] StringArray = new String[param.length()];
            for (int i = 0; i < param.length(); i++) {
                StringArray[i] = param.get(i).toString();
            }
            return StringArray;
        }
        return null;
    }
}
